package com.xian.manage.service.impl;

import java.util.List;
import com.xian.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xian.manage.mapper.PoetryMapper;
import com.xian.manage.domain.Poetry;
import com.xian.manage.service.IPoetryService;

/**
 * 诗词精选Service业务层处理
 * 
 * @author Hanys
 * @date 2025-04-09
 */
@Service
public class PoetryServiceImpl implements IPoetryService 
{
    @Autowired
    private PoetryMapper poetryMapper;

    /**
     * 查询诗词精选
     * 
     * @param id 诗词精选主键
     * @return 诗词精选
     */
    @Override
    public Poetry selectPoetryById(Long id)
    {
        return poetryMapper.selectPoetryById(id);
    }

    /**
     * 查询诗词精选列表
     * 
     * @param poetry 诗词精选
     * @return 诗词精选
     */
    @Override
    public List<Poetry> selectPoetryList(Poetry poetry)
    {
        return poetryMapper.selectPoetryList(poetry);
    }

    /**
     * 新增诗词精选
     * 
     * @param poetry 诗词精选
     * @return 结果
     */
    @Override
    public int insertPoetry(Poetry poetry)
    {
        poetry.setCreateTime(DateUtils.getNowDate());
        return poetryMapper.insertPoetry(poetry);
    }

    /**
     * 修改诗词精选
     * 
     * @param poetry 诗词精选
     * @return 结果
     */
    @Override
    public int updatePoetry(Poetry poetry)
    {
        poetry.setUpdateTime(DateUtils.getNowDate());
        return poetryMapper.updatePoetry(poetry);
    }

    /**
     * 批量删除诗词精选
     * 
     * @param ids 需要删除的诗词精选主键
     * @return 结果
     */
    @Override
    public int deletePoetryByIds(Long[] ids)
    {
        return poetryMapper.deletePoetryByIds(ids);
    }

    /**
     * 删除诗词精选信息
     * 
     * @param id 诗词精选主键
     * @return 结果
     */
    @Override
    public int deletePoetryById(Long id)
    {
        return poetryMapper.deletePoetryById(id);
    }
}
